class ProductPdf < Prawn::Document
  
  def initialize(product, view)
    super()
    @product = product
    @view = view
    text "Produkt #{@product.id}"
    draw_text "#{@product.title}", :at => [220, 575], size: 22
    logopath =  "#{Rails.root}/app#{@product.image_url.gsub("/assets/","/assets/images/")}"
    image logopath, :at => [220, 475], height: 100
    draw_text "#{@product.description}", :at => [10, 300], size: 12
    

  end
 
end